Ext.define('Seq.action.Crud', {
    alternateClassName: ['Seq.Action'],

    singleton: true,

    action(cfg, fn) {
        return Ext.apply({
            xtype: 'actioncolumn',
            align: 'center',
            menuDisabled: true,
            resizable: false,
            handler: fn
        }, cfg);
    },

    edit(cfg, fn) {
        return this.action({
            tooltip: '修改',
            iconCls: 'x-fa fa-pencil-square-o fa-action fa-aw',
        }, 'onEditActionClick');
    },

    del(cfg, fn) {
        return this.action({
            tooltip: '删除',
            iconCls: 'x-fa fa-trash-o fa-decline fa-aw',
        }, 'onDeleteActionClick');
    },

    favorite(cfg, fn) {
        return this.action({
            tooltip: '收藏',
            iconCls: 'x-fa fa-heart-o fa-action fa-aw',
        }, 'onFavoriteActionClick');
    },

    start(cfg, fn) {
        return this.action({
            tooltip: '启动',
            iconCls: 'x-fa fa-play fa-action fa-aw',
        }, 'onStartActionClick');
    },

    stop(cfg, fn) {
        return this.action({
            tooltip: '停止',
            iconCls: 'x-fa fa-stop fa-confirm fa-aw',
        }, 'onStopActionClick');
    },

    duplicate(cfg, fn) {
        return this.action({
            tooltip: '复制',
            iconCls: 'x-fa fa-copy fa-action fa-aw',
        }, 'onDuplicateActionClick');
    }

})